﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace HA.ModFlow.Controls.Windows.CopyResultSetName
{
    /// <summary>
    /// winCopyResultSetName.xaml 的交互逻辑
    /// </summary>
    public partial class winCopyResultSetName : Window
    {
        public winCopyResultSetName( string strName)
        {
            InitializeComponent();
            this.newName = strName;
        }
        public  string newName;
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.txtName.Text = newName;
        }

        private void btnOk_Click(object sender, RoutedEventArgs e)
        {
            this.newName = this.txtName.Text.Trim();
            if (this.newName.Length <= 25 && this.newName.Length > 0)
            {
                this.DialogResult = true;
                this.Close();
            }
            else
            {
                MessageBox.Show("名称的长度必须在0-25之间！","提示",MessageBoxButton.OK);
            }
        }

        private void btnCancal_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
    }
}
